{% extends "admin/base_site.html" %}
{% load i18n static admin_modify %}
{% load admin_urls %}

{% block extrahead %}{{ block.super }}
{% url 'admin:jsi18n' as jsi18nurl %}
<script type="text/javascript" src="{{ jsi18nurl|default:"../../../jsi18n/" }}"></script>
{{ media }}
{% endblock %}

{% block extrastyle %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />

<style type="text/css">

.selector {
    width: 980px;
    float: left;
}

.selector select {
    width: 470px;
    height: 17.2em;
}

.selector-available, .selector-chosen {
    float: left;
    width: 470px;
    text-align: center;
    margin-bottom: 5px;
}

</style>
{% endblock %}

{% block coltype %}{% if ordered_objects %}colMS{% else %}colM{% endif %}{% endblock %}

{% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %}

{% if not is_popup %}
{% block breadcrumbs %}
<div class="breadcrumbs">
  <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> &rsaquo;
  <a href="{% url 'admin:app_list' app_label=opts.app_label %}">
    {% if app_label == 'sites' %}
      {% trans "Websites" %}
    {% elif app_label.lower == 'qa' %}
      {% trans "QC" %}
    {% else %}
      {{ app_label|capfirst|escape }}
    {% endif %}
  </a> &rsaquo;
  {% if has_change_permission %}<a href="{% url opts|admin_urlname:'changelist' %}">{% if app_label == 'sites' and opts.verbose_name_plural == 'sites' %}Websites{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %}
&rsaquo; {% if add %}{% trans 'Add' %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %}
</div>
{% endblock %}
{% endif %}

{% block content %}<div id="content-main">
{% block object-tools %}
{% if change %}{% if not is_popup %}
  <ul class="object-tools">
    {% block object-tools-items %}
    <li><a href="{% url opts|admin_urlname:'history' adminform.form.instance.pk %}" class="historylink">{% trans "History" %}</a></li>
    {% if has_absolute_url %}<li><a href="{% firstof original.get_absolute_url absolute_url %}" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif %}
    {% endblock %}
  </ul>
{% endif %}{% endif %}
{% endblock %}
<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form" novalidate="novalidate">{% csrf_token %}{% block form_top %}{% endblock %}
<div>
{% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
{% if save_on_top %}{% block submit_buttons_top %}{% submit_row %}{% endblock %}{% endif %}
{% if errors %}
    <p class="errornote">
    {% blocktrans count counter=errors|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
    </p>
    {{ adminform.form.non_field_errors }}
{% endif %}

{% block field_sets %}
{% for fieldset in adminform %}
  {% include "admin/includes/fieldset.html" %}
{% endfor %}
{% endblock %}

{% block after_field_sets %}{% endblock %}

{% block inline_field_sets %}
{% for inline_admin_formset in inline_admin_formsets %}
    {% include inline_admin_formset.opts.template %}
{% endfor %}
{% endblock %}

{% block after_related_objects %}{% endblock %}

{% block submit_buttons_bottom %}{% submit_row %}{% endblock %}

{% if adminform and add and adminform.first_field.id_for_label %}
   <script type="text/javascript">document.getElementById("{{ adminform.first_field.id_for_label }}").focus();</script>
{% endif %}

{# JavaScript for prepopulated fields #}
{% prepopulated_fields_js %}

</div>
</form></div>
{% endblock %}
